#ifndef CIMAGE_H_
#define CIMAGE_H_

#include <e32def.h>
#include <e32const.h>
#include <e32base.h>
#include "ImageLocation.h"
#include <gdi.h>

class CImage : public CBase
{
public:
	CImage();
	virtual ~CImage();
	
public:
	static CImage* CreateImage(const THcImageLocation& aLocation);
	
public:
	virtual void ConstructL();
	virtual void Draw(CBitmapContext& aGc,const TRect& aRc);
	virtual void Draw(CBitmapContext& aGc,const TRect& aRc,TSize aCorner,TInt aOpacity);
public:
	CFbsBitmap* CreateMask(const TSize& aCorner, TInt aOpacity, const TSize& aSize, TBool aInvertMask, CFbsBitmap* aOrginal);
public:
	THcImageLocation& GetImageLocation();
protected:
	THcImageLocation iLocation;
	TInt iRef;
	TBool iLoaded;
	TSize iSize;
public:
	void AddRef();
	void Release();
	
public:
	TSize GetSize();
	TBool IsLoaded();
};

#endif /*CIMAGE_H_*/
